<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/29 0029
 * Time: 上午 9:15
 */

namespace app\sports_admin\vaildate;


class Banner extends Base
{
    protected $rule = [
        'id'=>'require|isPositiveInteger',
    ];

    protected $message = [
        'id'=>'编号必须为整数',
    ];
    //修改排序字段值
    public function updateSort()
    {
        $rule = [
            'sort'=>'require|integer',
            'id'=>'require|integer',
        ];
        $msg = [
            'sort'=>'排序字段类型错误',
            'id'=>'请选择需要排序的字段',
        ];
        self::goCheck($rule,$msg);
    }
    //添加导航图
    public function insert()
    {
        $rule = [
            'img'=>'require',
            'url'=>'require|url'
        ];
        $msg = [
            'img'=>'请上传图片',
            'url'=>'请输入正确的url'
        ];
        self::goCheck($rule,$msg);
    }
    //修改导航图片
    public function updateImage()
    {
        $rule = [
            'img'=>'require',
            'id'=>'require|integer'
        ];
        $msg = [
            'img'=>'请上传图片',
            'id'=>'请选择需要修改图片的信息',
        ];
        self::goCheck($rule,$msg);
    }
}